package com.ruoyi.system.service.impl;

import com.ruoyi.common.core.text.Convert;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.system.domain.JiajiaHospitalDepartment;
import com.ruoyi.system.mapper.JiajiaHospitalDepartmentMapper;
import com.ruoyi.system.service.IJiajiaHospitalDepartmentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 医院科室Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-05-06
 */
@Service
public class JiajiaHospitalDepartmentServiceImpl implements IJiajiaHospitalDepartmentService
{
    @Autowired
    private JiajiaHospitalDepartmentMapper jiajiaHospitalDepartmentMapper;

    /**
     * 查询医院科室
     * 
     * @param id 医院科室主键
     * @return 医院科室
     */
    @Override
    public JiajiaHospitalDepartment selectJiajiaHospitalDepartmentById(Long id)
    {
        return jiajiaHospitalDepartmentMapper.selectJiajiaHospitalDepartmentById(id);
    }

    /**
     * 查询医院科室列表
     * 
     * @param jiajiaHospitalDepartment 医院科室
     * @return 医院科室
     */
    @Override
    public List<JiajiaHospitalDepartment> selectJiajiaHospitalDepartmentList(JiajiaHospitalDepartment jiajiaHospitalDepartment)
    {
        return jiajiaHospitalDepartmentMapper.selectJiajiaHospitalDepartmentList(jiajiaHospitalDepartment);
    }

    /**
     * 新增医院科室
     * 
     * @param jiajiaHospitalDepartment 医院科室
     * @return 结果
     */
    @Override
    public int insertJiajiaHospitalDepartment(JiajiaHospitalDepartment jiajiaHospitalDepartment)
    {
        jiajiaHospitalDepartment.setCreateTime(DateUtils.getNowDate());
        return jiajiaHospitalDepartmentMapper.insertJiajiaHospitalDepartment(jiajiaHospitalDepartment);
    }

    /**
     * 修改医院科室
     * 
     * @param jiajiaHospitalDepartment 医院科室
     * @return 结果
     */
    @Override
    public int updateJiajiaHospitalDepartment(JiajiaHospitalDepartment jiajiaHospitalDepartment)
    {
        jiajiaHospitalDepartment.setUpdateTime(DateUtils.getNowDate());
        return jiajiaHospitalDepartmentMapper.updateJiajiaHospitalDepartment(jiajiaHospitalDepartment);
    }

    /**
     * 批量删除医院科室
     * 
     * @param ids 需要删除的医院科室主键
     * @return 结果
     */
    @Override
    public int deleteJiajiaHospitalDepartmentByIds(String ids)
    {
        return jiajiaHospitalDepartmentMapper.deleteJiajiaHospitalDepartmentByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除医院科室信息
     * 
     * @param id 医院科室主键
     * @return 结果
     */
    @Override
    public int deleteJiajiaHospitalDepartmentById(Long id)
    {
        return jiajiaHospitalDepartmentMapper.deleteJiajiaHospitalDepartmentById(id);
    }
}
